package com.mhc.suzuki.manager.impl;

import com.mhc.suzuki.dal.mapper.ext.RefundDepositExtMapper;
import com.mhc.suzuki.dal.model.RefundDepositDO;
import com.mhc.suzuki.dal.query.RefundDepositQuery;
import com.mhc.suzuki.manager.RefundDepositManager;
import com.subaru.common.query.PageResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;


/**
 * Manager for RefundDeposit.
 */

@Component
public class RefundDepositManagerImpl implements RefundDepositManager {


    @Autowired
    protected RefundDepositExtMapper refundDepositExtMapper;

    /**
     * query count by query condition.
     */
    @Override
    public int countByQuery(RefundDepositQuery query) {
        return refundDepositExtMapper.countByQuery(query);
    }

    /**
     * delete by query condition.
     */
    @Override
    public int deleteByQuery(RefundDepositQuery query) {
        return refundDepositExtMapper.deleteByQuery(query);
    }

    /**
     * delete by primary key.
     */
    @Override
    public int deleteByPrimaryKey(RefundDepositDO record) {
        return refundDepositExtMapper.deleteByPrimaryKey(record);
    }

    /**
     * insert selective.
     */
    @Override
    public long insertSelective(RefundDepositDO record) {
        return refundDepositExtMapper.insertSelective(record);
    }

    /**
     * select by query condition.
     */
    @Override
    public List<RefundDepositDO> selectByQuery(RefundDepositQuery query) {
        return refundDepositExtMapper.selectByQuery(query);
    }

    /**
     * select by query condition with page.
     */
    @Override
    public PageResult<RefundDepositDO> selectByQueryWithPage(RefundDepositQuery query) {
        PageResult<RefundDepositDO> result = new PageResult<RefundDepositDO>();
        result.setPageSize(query.getPageSize());
        result.setPageNo(query.getPageNo());
        result.setTotalCount(this.countByQuery(query));
        result.setResult(this.selectByQuery(query));
        return result;
    }

    /**
     * select by primary key.
     */
    @Override
    public RefundDepositDO selectByPrimaryKey(Long id) {
        return refundDepositExtMapper.selectByPrimaryKey(id);
    }

    /**
     * update by query condition selective.
     */
    @Override
    public int updateByQuerySelective(RefundDepositDO record, RefundDepositQuery query) {
        return refundDepositExtMapper.updateByQuerySelective(record, query);
    }

    /**
     * update by query condition.
     */
    @Override
    public int updateByQuery(RefundDepositDO record, RefundDepositQuery query) {

        return refundDepositExtMapper.updateByQuery(record, query);
    }

    /**
     * update by primary key selective.
     */
    @Override
    public int updateByPrimaryKeySelective(RefundDepositDO record) {
        return refundDepositExtMapper.updateByPrimaryKeySelective(record);
    }
}